from os import times_result
from froModuleDrivers.homeDeviceDriver import HomeDeviceDriver # 引用家居设备控制器驱动模块
from froModuleDrivers.nioManager import NioManager # 引用驱动管理模块
import time

# 驱动初始化
driver_siren = HomeDeviceDriver("192.168.50.145", 4001)
manager = NioManager(driver_siren)
manager.run()

# 报警器相关的3个API
# 1、获取报警器的状态，报警器开，返回True，报警器关或不存在模块，返回False
print(driver_siren.isAlarming(6))

# 2、打开报警器
driver_siren.alarm(6)
time.sleep(1)

# 3、关闭报警器
driver_siren.quitAlarm(6)
time.sleep(1)

# 等待指令执行完毕后系统退出
manager.shutdownGracefully()